﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using InsuranceSell.Code.Entities;
using InsuranceSell.Code.Data;
using System.Data;

namespace InsuranceSell.Code.Services
{
    public static class UserServices
    {
        public static bool AddNewUser(User user)
        {
            UserDAO userDAO = new UserDAO();
            return userDAO.AddNewUser(user);
        }

        public static DataTable LoadAllUsers()
        {
            UserDAO userDAO = new UserDAO();
            return userDAO.LoadAllUsers();
        }
        public static bool DeleteUser(User user)
        {
            UserDAO userDAO = new UserDAO();
            return userDAO.DeleteUser(user);
        }
        public static bool UpdateUser(User user) {
            UserDAO userDAO = new UserDAO();
            return userDAO.UpdateUser(user);
        }

        public static DataTable CheckUserLogin(string username, string password)
        {
            UserDAO userDAO = new UserDAO();
            return userDAO.CheckUserLogin(username, password);
        }
    }
    
}
